package thread;

import java.util.Scanner;

/**
 *
 */
public class SleepDemo {
    public static void main(String[] args) {
        System.out.println("程序开始,输入一个数字");
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();
        try{
            while (num>0){
                num--;
                Thread.sleep(1000);
                System.out.println(num);
            }
            System.out.println("时间到!!!");
        }catch (InterruptedException e){
            e.printStackTrace();
        }
        System.out.println("程序结束");
    }
}
